package com.ljx.qqpro.service.impl;

import com.ljx.qqpro.dto.chat.ChatCell;
import com.ljx.qqpro.entity.ChatEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ljx.qqpro.common.utils.PageUtil;
import com.ljx.qqpro.common.utils.Query;

import com.ljx.qqpro.dao.ChatUserDao;
import com.ljx.qqpro.entity.ChatUserEntity;
import com.ljx.qqpro.service.ChatUserService;


@Service("chatUserService")
public class ChatUserServiceImpl extends ServiceImpl<ChatUserDao, ChatUserEntity> implements ChatUserService {

    @Override
    public PageUtil queryPage(Map<String, Object> params) {
        IPage<ChatUserEntity> page = this.page(
                new Query<ChatUserEntity>().getPage(params),
                new QueryWrapper<ChatUserEntity>()
        );

        return new PageUtil(page);
    }

    @Override
    public List<ChatCell> queryChatList(Long userId) {
        return this.baseMapper.queryChatList(userId);
    }
}